package test2.spider.news.tencent;

import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

import test2.spider.BaseProcessor;

public class MainFirstProcessor extends BaseProcessor {
	
	static String host = "http://finance.qq.com";

	@Override
	protected void parse(Document doc) {
		Element root = doc.getElementById("listZone");
		Elements divs = root.select("div.Q-tpWrap");
		for(Element div : divs) {
			String href = host + div.select("a").attr("href");
			Tencent.threadPool.submit(new Runnable() {
				@Override
				public void run() {
					new DetailProcessor().process(href, "gbk");					
				}
			});
		}
	}

}
